Repository navigation
fix(take): a take's lazy baseline holds only the take before's final state, so a watched world's heap stops growing (#2585) - #2586
Merged
Conversation
…, not its body, so dropped takes are collected (#2585) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
genekogan
marked this pull request as ready for review
November 16, 2026 09:47
Contributor
Proof check:
|
| Check | Status | Detail |
|---|---|---|
| maintainer sign-off | ok | approved:maintainer added by @genekogan |
| problem statement | ok | present |
| linked issue | ok | #2585, #2427 |
| acceptance | ok | 3/3 met |
| carried from the issue | ok | all 3 issue criteria present |
| self-audit | ok | checks, failed attempts, long tail and limits filled |
| clip | ok | 1 video link(s), 1 image(s) |
| proof.json | ok | valid and agrees with the checklist |
| playtest | ok | main 3d8da8a + #2583 (agent/v0b-main): 0/2, candidate: main + #2583 + this fix (agent/v0b-cand): 2/2 |
| reviewer pass | ok | independent reviewer agent (coordinator dispatch): approve |
Acceptance criteria
| Criterion | Status | Evidence | |
|---|---|---|---|
| [x] | A1 Step 0, then a heap-only bisect. Step 0: reproduce the heap on main (o | met | #2585 (comment) |
| [x] | A2 Fix the cause, or revert the offending change if a fix doesn't fit, wi | met | node --test packages/engine-mars/src/take-retain.test.ts -> fail before the fix, pass after |
| [x] | A3 Re-run viewers --viewers 50,200, 2 repeats, main against the candida |
met | #2585 (comment) |
Proof links: 1 video, 1 image, proof.json linked.
Full-resolution videos — use the original clips and their proof metadata for motion/contact review. GIFs below are reduced previews.
Updated on every edit, push, label and review. How to fill it: .claude/skills/journal/SKILL.md. T3-T4 also need the maintainer's sign-off (tools/proof/gate.mjs). A maintainer can waive with the proof:waived label.
Member
Author
|
Independent reviewer pass (T3): approve, no blocking findings.
|
4 tasks
genekogan
enabled auto-merge
November 16, 2026 11:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Since 0.129 a watched world's heap grows for as long as it has viewers. It is about 930 MB at 50 viewers, against 450 MB on 14 Nov code. At 200 viewers it reaches 3 to 6 GB, the clock collapses and every viewer reconnects. Closes #2585. Part of the scaling tranche (lane V, V0b).
The cause is in #2427's lazy take hashes.
baselineStateHashwas read through() => body.finalStateHashof the take before.TEXT, cached by copy identity).Now
finishLazyreturnscaptureFinalState's own cached hash function, which holds only that take's final state. The body's field reads that same function, so every value is unchanged.Acceptance
timed-run viewers --viewers 50, 2 repeats on souls-timed. Then bisect df7c294..main by heap median at 50 viewers, with e46c9df (perf(take): a take's hashes are computed when first read, not in the tick that cuts it (#2422) #2427) as the first point. Declare the plan and bars here before any run; at most 6 bisect runs. If the heap does not separate at 50 viewers, say so and hand back. — evidence: Scaling V0b · The world's heap doubles under viewers since 16 Nov; 200 viewers restart a world #2585 (comment)node --test packages/engine-mars/src/take-retain.test.ts-> fail before the fix, pass afternode --test packages/engine-mars/src/take-retain.test.ts-> fails before the fix: all of the first 20 takes' final states are still reachable after 40 takes. Passes after: none are.node --test packages/engine-mars/src/take-recut.test.ts-> pass. Takes stay byte-identical to main before the lazy hashes (ids, baselines, final hashes; read late and every tick).viewers --viewers 50,200, 2 repeats, main against the candidate: heap median at 200 at most 607 MB; no watchdog restart; at least 0.95 of the clock at 200; acts accepted at 50 not worse than main. — evidence: Scaling V0b · The world's heap doubles under viewers since 16 Nov; 200 viewers restart a world #2585 (comment)Proof
Tier: T3 (
node tools/proof/tier.mjs: packages/engine-mars/src/take-retain.test.ts; the recorder is under mars/)timed-run clip --kit souls-runon the runner GPU (43839734644) at 3a00bd8. Eden 2026, fake minds: a viewer follows Runa from arrival to an upstairs classroom. The live takes it plays come from the fixed recorder, and playback is continuous throughout.timed-run viewers --viewers 50,200on souls-timed, 2 repeats per arm, main and candidate dispatched together. Own cores at start 0.3 to 0.8 % busy, machine 2 to 11 %; the world ran on two physical cores and the load on the rest.Self-audit
node --test packages/engine-mars/src/take-retain.test.ts packages/engine-mars/src/take-recut.test.ts-> 2 pass.take-retainfails before the fix.node --teston mars take, take-golden, take-fields, sleep-take and take-transport -> 18 passtsc --noEmit -p packages/engine-marsand-p mars/viewer-> cleannode .github/scripts/guards.mjs scrub --base origin/main-> 0 problemsnode tools/changelog/compile.mjs --check-> validdocs/mars/takes-and-plans.mdsays what a take costs and stays true.Outside Touches
none
Time
09:19 to 09:50 UTC, about 31 min against the 3 h ceiling. About 20 min of that was waiting on the runs.
Changelog
changes/2585-take-baseline-chain.mdRisk
take-recut.test.tspins.take-recutand the take golden test pin it.🤖 Generated with Claude Code
Coordinator sign-off (T3): the independent reviewer approved with no blocking findings (comment above). All of A1–A3 are met with the runs declared beforehand. It ships in 0.130: this leak is live in production on 0.129.